export default {
  watch: {
    'prodValue.fcraftName': {
      handler(val) {
        if (val) {
          this.prodOptions.FLABORCOST.disabled = true
        } else {
          this.prodOptions.FLABORCOST.disabled = false
        }
      }
    }
  },
  methods: {
    // Form表单
    handleSetForm() {
      // 其它
      this.otherOptions = {
        fcreator: {
          label: this.$t('market.creator'),
          disabled: 'disabled'
        },
        fcreatedate: {
          label: this.$t('market.createDate'),
          disabled: 'disabled'
        },
        fmodifier: {
          label: this.$t('market.modifier'),
          disabled: 'disabled'
        },
        fmodifydate: {
          label: this.$t('market.modifyDate'),
          disabled: 'disabled'
        },
        fapprover: {
          label: this.$t('market.approver'),
          disabled: 'disabled'
        },
        fapprovedate: {
          label: this.$t('market.approveDate'),
          disabled: 'disabled'
        },
        fforbidder: {
          label: this.$t('market.forbider'),
          disabled: 'disabled'
        },
        fforbiddate: {
          label: this.$t('market.forbidDate'),
          disabled: 'disabled'
        }
      }
      // 物料form
      this.prodValue = {
        FIMG: '',
        FNUMBER: '',
        FDESCRIPTION: '',
        FSPECIFICATION: '',
        FLABORCOST: 0,
        FMATERIALCOST: 0,
        FUNIT: '',
        FMODEL: '',
        FGROSSWEIGHT: 0,
        FNETWEIGHT: '',
        FWEIGHTUNIT: '',
        fname: '',
        fcraftName: '', // 工艺
        fcraftId: 0, // 工艺id
        workingHours: 0,
        artificialSum: 0
      }

      this.prodOptions = {
        FNUMBER: {
          type: 'inptBer',
          label: this.$t('market.fmaterial'),
          span: 6,
          labelWidth: '120px'
        },
        FMODEL: {
          label: this.$t('market.fmodel'),
          span: 18,
          disabled: true,
          labelWidth: '120px'
        },
        fname: {
          label: this.$t('shop.fname2'),
          labelWidth: '120px',
          disabled: true
        },
        FDESCRIPTION: {
          label: this.$t('market.fdescripTion'),
          labelWidth: '120px',
          type: 'input_textarea',
          span: 16,
          disabled: true
        },
        FMATERIALCOST: {
          label: this.$t('market.materialcost'),
          labelWidth: '120px',
          disabled: true
        },
        FSPECIFICATION: {
          label: this.$t('shop.fspecificaTion'),
          labelWidth: '120px',
          disabled: true
        },
        FBASEUNIT: {
          label: this.$t('market.baseUnit'),
          labelWidth: '120px',
          disabled: true
        },
        FWEIGHTUNIT: {
          label: this.$t('market.weightUnit'),
          labelWidth: '120px',
          disabled: true
        },
        FLABORCOST: {
          label: this.$t('market.laborcost'),
          type: 'number',
          disabled: true,
          labelWidth: '120px',
          precision: 4,
          min: 0.0001,
          step: 0.0001
        },
        fcraftName: {
          label: this.$t('market.craft'),
          type: 'magnifier',
          labelWidth: '120px',
          readonly: 'readonly',
          placeholder: '请输入工艺'
        },
        FGROSSWEIGHT: {
          label: this.$t('market.grossweight'),
          labelWidth: '120px',
          disabled: true
        },
        FNETWEIGHT: {
          label: this.$t('market.netweight'),
          labelWidth: '120px',
          disabled: true
        },
        workingHours: {
          label: this.$t('market.workingHours'),
          type: 'number',
          labelWidth: '120px'
        },
        artificialSum: {
          label: this.$t('market.artificialSum'),
          type: 'number',
          labelWidth: '120px'
        }
      }
    }
  }
}
